-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Vulkan shader gen binary path when Cross-compiling #11096
Conversation
There's already an open PR for cross compiling fixes (#10448), which has been taking a while (@sparkleholic @bandoti). Are the changes related or is this a separate fix? |
This is a fix for #11037 |
These are two separate issues. In the case of #11037 they seem to have some super project which includes Llama.cpp as a submodule from another CMakeList.txt. @sparkleholic has a fix for cross compiling for example using Linux on x86_64 with a build target of aarch64. In this case, it ensure the shaders are generated using the build system architecture. |
Thank you for the fix! |
This PR reintroduced the issue that was fixed in #11037 when compiling with Vulkan enabled on Windows x64 using LLVM. @ag2s20150909 On which setup have you encountered an issue that this PR solves? I'd like to try to reproduce it so we can find a fix that works for both cases. |
@0cc4m I don't cross-compile, but since I use a toolchain file that does It's a bit hacky, but I think a fix for this can be to test whether there's a file at the given path, and add the |
Hmm. This sounds like you need the cross-compile fixes in #10448 when compiling from Windows to Arm64 (definitely). In the other case, you are effectively cross-compiling as well, as you said, except it's from the same architecture to itself. I think the way to fix this is when
|
Would the original check ( |
@giladgd If you would like to test against my branch with the latest fixes from @sparkleholic here: https://github.com/bandoti/llama.cpp/tree/sparkle_master_fix, I have it updated to latest with the fixes. We're just waiting to here back from the original author to get it merged in. I am curious if this would fix the problem for you. |
@0cc4m It seems to work well both on Windows x64 and Windows arm64.
@bandoti Your branch fails to compile on my Windows x64 machine with LLVM with this error:
I can give you setup instructions on how to replicate this on a Windows x64 machine with my custom LLVM toolchain so you can test it yourself; let me know if you're interested. |
@giladgd Yes that would be helpful! I will test it and see what happens. Thanks. |
@bandoti In To replicate the Windows 10 x64 setup I tested on, make sure you have Node.js v22 installed, all the Visual Studio build tools components as detailed here, and also the Vulkan dependencies described here. Then run these commands:
The last command is the one that failed to build on my Windows 10 x64 machine. It attempts to use LLVM automatically if it detects that it's installed (either as part of the Visual Studio build tools, or separately), and if it doesn't find it then it fallbacks to using MSVC. |
@giladgd I forgot to mention that there's a way to specify a separate toolchain for the Vulkan-shaders-gen which bypasses finding on the system path. Please try passing this to cmake using my sparkle_master_fix branch.
This toolchain will then be used to build the runnable app on build system. |
That being said the issue may be the find_program commands need NO_CMAKE_FIND_ROOT_PATH to prevent it from searching wrong dir. hierarchy. |
Cross-compiling uses the host system's tools,hard-coded paths won't work.